package com.gagakuai.exception;

import com.gagakuai.enumeration.BusinessCodeEnum;
import lombok.Getter;
import org.springframework.http.HttpStatus;

/*
 * 统一异常处理
 */
@Getter
public class SettementException extends RuntimeException {



    private BusinessCodeEnum codeEnum;

    private Integer status = 400;

    public SettementException(String msg) {
        super(msg);
    }

    public SettementException(HttpStatus status, String msg) {
        super(msg);
        this.status = status.value();
    }

    public SettementException(int code, String msg) {
        super(msg);
        this.status = code;
    }


    public SettementException(BusinessCodeEnum businessCodeEnum) {

        this.codeEnum = businessCodeEnum;
    }
}

